// app.js
import net from './js/net'
import http from './js/http'
App({
  onLaunch() {
    // 展示本地存储能力
    const logs = wx.getStorageSync('logs') || []
    logs.unshift(Date.now())
    wx.setStorageSync('logs', logs)
    //获取名称
    http.request("index.php?r=api/index/webname").then((res)=>{
      if(res.data.result==1){
        wx.setNavigationBarTitle({
          title: res.data.data,
        })
        wx.setStorageSync('web_name', res.data.data)
      }
    });
    // 登录
    wx.login({
      success: res => {
        // 发送 res.code 到后台换取 openId, sessionKey, unionId
      }
    })
  },
  globalData: {
    userInfo: null
  },
  http:http,
  url:net.url,
  pic_url:net.http_url+"wximage/",
})
